
#include <iostream>

#include <QApplication>
#include <QTranslator>
#include <QDesktopWidget>
#include "taskmonitorwidget.h"

using namespace std;

int main(int argc, char *argv[])
{
    try {
        QApplication app(argc, argv);
        QTranslator appTranslator;

	/*默认使用当前路径下的语言文件，也可通过命令行参数指定特定路径，
	 * 注意文件名不能随意更改*/
        appTranslator.load("i18n/QTaskMan.cn",
			argc > 1 ? argv[1] : "");
        app.installTranslator(&appTranslator);



        TaskMonitorWidget *monitor = new TaskMonitorWidget;
        monitor->show();

        QDesktopWidget *desktop = QApplication::desktop();
        QRect screen_geo = desktop->screenGeometry(monitor);
        int x = screen_geo.width() / 6;
        int y = screen_geo.height() / 6;
        monitor->move(x, y);

        return app.exec();

    } catch (Error &e) {
        cerr << e.getFile() << "," << e.getLineNum() << "," << e.getMessage() << endl;
    }
}
